package 反射;

import com.jiazhong.Model.Goods;

public class ReflectDemo1 {
    public static void main(String[] args) throws ClassNotFoundException {
        //通过类的完整路径字符串获得类的字节码对象
        Class cla = Class.forName("com.jiazhong.Model.Goods");
        System.out.println(cla);
        //通过类名获得类的字节码对象
        Class cla1=Goods.class;
        System.out.println(cla1);
        //通过对象来获得类的字节码对象
        Goods goods=new Goods();
        Class cla2=goods.getClass();
        System.out.println(cla2);
    }
}
